package com.jinlia.show.modules.base.wxapp.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.jinlia.show.common.core.entity.BaseEntity;
import com.jinlia.show.modules.base.config.DynamicSchemaConfig;
import com.jinlia.show.modules.base.constant.PayMethodTypeEnum;
import com.jinlia.show.modules.base.constant.i.IBaseEnum;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 支付单支付记录
 */
@Data
@TableName(value = "wxapp_pay_order_record", schema = DynamicSchemaConfig.schema_wxapp)
public class PayOrderRecord extends BaseEntity {

    @TableId
    private Long id;

    /**
     * 付款单id
     */
    private Long payOrderId;
    /**
     * 支付金额
     */
    private BigDecimal payAmount;
    /**
     * 收款状态 0:已支付:见 PayResultStatusEnum
     */
    private String payStatus;
    /**
     * 付款人
     */
    private String payUserName;
    /**
     * 付款人id
     */
    private Long payUserId;
    /**
     *
     */
    private Long memberCardId;

    /**
     * 支付单类型 见 :PayMethodTypeEnum
     */
    private String payMethodType;
    /**
     * 备注
     */
    private String remark;
    @TableField(exist = false)
    private String payMethodTypeName;
    public void setPayMethodType(String payMethodType) {
        this.payMethodType = payMethodType;
        this.payMethodTypeName = IBaseEnum.getLabelByValue(payMethodType, PayMethodTypeEnum.class);
    }
}
